﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CaiyinSoft.NetGather.Protocol;

namespace CaiyinSoft.NetGather.NetGatherLib.Filter.Generate
{
    [Serializable]
    public class GUIDHTMLAnalyze : HTMLFilterBase
    {


        public override string FilterCaption
        {
            get
            {
                return "GUID生成器";
            }
        }

        public override string ExpressionCaption
        {
            get
            {
                return "";
            }
        }

        public override string Description
        {
            get
            {
                return "生成GUID";
            }
        }

        public GUIDHTMLAnalyze()
            : base()
        {
            _InitParams();
        }

        private void _InitParams()
        {
            SetInputHTML("");
            OutputKey = "GUID";
        }

        public override List<FilterResult> FilterHTML()
        {
            int parentHTMLPosition = 0;
            if (ParentFilter != null)
                parentHTMLPosition = ParentFilter.HTMLPosition;
            HTMLPosition = parentHTMLPosition;

            return new List<FilterResult>() { new FilterResult(HTMLPosition, Guid.NewGuid().ToString()) };
        }
    }
}
